import request from "../utils/service";

/**
 * 添加地址
 * @author Lijian
 * @param {string} userid 用户id
 * @param {string} name 收货人姓名
 * @param {string} tel 收货人手机号
 * @param {string} province 省
 * @param {string} city 市
 * @param {string} county 区
 * @param {string}addressDetail 详细地址
 * @param {boolean} isDefault 是否默认地址
 * @returns 添加地址数据
 */

export let address_add = (
  userid: string,
  name: string,
  tel: string,
  province: string,
  city: string,
  county: string,
  addressDetail: string,
  isDefault:boolean
) => {
  return request({
    url: "/address/add",
    method: "POST",
    data: {
        userid,
        name,
        tel,
        province,
        city,
        county,
        addressDetail,
        isDefault
    },
  });
};
/**
 * 地址列表
 *  @author Lijian
 * @param {string} userid 用户id 
 * @returns 地址列表
 */
export function address_list(payload={}){
  return request.get("/address/list",{params:payload})
}
